package com.lyz.moil.web.entity;

import com.lyz.moil.core.orm.hibernate.BaseEntity;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

/**
 * Created with IntelliJ IDEA.
 * User: xi
 * Date: 13-11-19
 * Time: 下午6:01
 * To change this template use File | Settings | File Templates.
 */
@Entity
public class Session extends BaseEntity {

    public Session(String sessionId) {
        this.uuid = sessionId;
    }

    public Session() {
    }

    @GeneratedValue(generator = "system-uuid")
    @GenericGenerator(name = "system-uuid", strategy = "assigned")
    private String uuid;

    @Version
    private int version;

    @Column(name = "type", length = 32, updatable = false)
    private String type;

    @Column(name = "client_ip", length = 64, updatable = false)
    private String clientIp;

    @Column(name = "description", length = 256, updatable = false)
    private String description;

    @Column(name = "user_agent", length = 512, updatable = false)
    private String userAgent;

    @Column(name = "client_type", length = 128, updatable = false)
    private String clientType;

    @Column(updatable = false)
    private String creator;


    @Column(name = "sign_str", length = 256)
    private String signStr;

    private Long expireTime;

    @Column(length = 128, updatable = false)
    private String loginName;

    private String deviceId;

    @Transient
    private String sessionFullStr;

    @Transient
    private String password;


    private String nickName;


    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getClientIp() {
        return clientIp;
    }

    public void setClientIp(String clientIp) {
        this.clientIp = clientIp;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getUserAgent() {
        return userAgent;
    }

    public void setUserAgent(String userAgent) {
        this.userAgent = userAgent;
    }

    public String getClientType() {
        return clientType;
    }

    public void setClientType(String clientType) {
        this.clientType = clientType;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    public String getSignStr() {
        return signStr;
    }

    public void setSignStr(String signStr) {
        this.signStr = signStr;
    }

    public Long getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(Long expireTime) {
        this.expireTime = expireTime;
    }

    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

    public String getSessionFullStr() {
        return sessionFullStr;
    }

    public void setSessionFullStr(String sessionFullStr) {
        this.sessionFullStr = sessionFullStr;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }
}
